﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RequestsList.aspx.cs" Inherits="User_RequestsList" MasterPageFile="~/Site.master" %>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <br/>
    <asp:HyperLink ID="UserLink" runat="server" NavigateUrl="UserPanel.aspx">Панель пользователя</asp:HyperLink>
&nbsp;<span class="Apple-style-span" 
        style="color: rgb(105, 105, 105); font-family: 'Helvetica Neue', 'Lucida Grande', 'Segoe UI', Arial, Helvetica, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">→&nbsp; </span> 
    <b><asp:Label ID="UserLabel" runat="server" Text="Запросы" ForeColor="black"></asp:Label></b><br/>

<br />
 <asp:GridView ID="RequestListGridView" runat="server" 
                    AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
        DataKeyNames="CreditRequestId" 
        ondatabinding="RequestListGridView_DataBinding" 
        onselectedindexchanged="RequestListGridView_SelectedIndexChanged">
                    <Columns>
                        <asp:CommandField SelectText="Подробнее" ShowSelectButton="True" />
                        <asp:BoundField DataField="Кредит" HeaderText="Кредит" 
                            SortExpression="Кредит" />
                        <asp:BoundField DataField="Сумма" HeaderText="Сумма" SortExpression="Сумма" />
                        <asp:BoundField DataField="Валюта" HeaderText="Валюта" 
                            SortExpression="Валюта" />
                        <asp:BoundField DataField="Срок" HeaderText="Срок" SortExpression="Срок" />
                        <asp:BoundField DataField="Статус" HeaderText="Статус" 
                            SortExpression="Статус" />
                        <asp:BoundField DataField="CreditRequestId" HeaderText="CreditRequestId" 
                            InsertVisible="False" ReadOnly="True" SortExpression="CreditRequestId" 
                            Visible="False" />
                    </Columns>
                    <EmptyDataTemplate>
                        Запросов нет. Новый запрос можно оформить в разделе кредиты.
                    </EmptyDataTemplate>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:BankDBConnectionString %>" 
        
        SelectCommand="SELECT Credit.Name AS Кредит, CreditRequest.Amount AS Сумма, Currency.Name AS Валюта, CreditRequest.TermLength AS Срок, RequestStatus.Name AS Статус, CreditRequest.CreditRequestId FROM CreditRequest INNER JOIN Credit ON CreditRequest.CreditId = Credit.CreditID INNER JOIN Currency ON CreditRequest.CurrencyId = Currency.CurrencyID INNER JOIN UserProfile ON CreditRequest.UserProfileId = UserProfile.ProfileId INNER JOIN RequestStatus ON CreditRequest.RequestStatusId = RequestStatus.RequestStatusId WHERE (UserProfile.ProfileId = @UserProfileId)"
        >
                    <SelectParameters>
                        <asp:Parameter Name="UserProfileId" />
                    </SelectParameters>
                </asp:SqlDataSource>

</asp:Content>